/**
  ******************************************************************************
  * @file    USART/DMA_Interrupt/platform_config.h 
  * @author  MCD Application Team
  * @version V3.5.0
  * @date    08-April-2011
  * @brief   Evaluation board specific configuration file.
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  ******************************************************************************
  */ 

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __PLATFORM_CONFIG_H
#define __PLATFORM_CONFIG_H

/* Includes ------------------------------------------------------------------*/
#include "types.h"
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Uncomment the line corresponding to the STMicroelectronics evaluation board
   used to run the example */
   
#if defined(PHYSENSOR)

//****************************************************	
// 				USART1 CONFIGURATION
//****************************************************
#define USART1_CLK               RCC_APB2Periph_USART1
#define USART1_GPIO				 GPIOA
#define USART1_GPIO_CLK          RCC_APB2Periph_GPIOA
#define USART1_RxPin             GPIO_Pin_10
#define USART1_TxPin             GPIO_Pin_9
#define USART1_Tx_DMA_Channel	 DMA1_Channel4
#define USART1_Rx_DMA_Channel	 DMA1_Channel5
#define USART1_Tx_DMA_IRQn		 DMA1_Channel4_IRQn
#define USART1_Rx_DMA_IRQn		 DMA1_Channel5_IRQn
#define USART1_DR_Base			 0x40013804

//****************************************************	
// 				USART2 CONFIGURATION
//****************************************************
#define USART2_CLK               RCC_APB1Periph_USART2
#define USART2_GPIO				 GPIOA
#define USART2_GPIO_CLK          RCC_APB2Periph_GPIOA
#define USART2_RxPin             GPIO_Pin_3
#define USART2_TxPin             GPIO_Pin_2
#define USART2_Tx_DMA_Channel	 DMA1_Channel7
#define USART2_Rx_DMA_Channel	 DMA1_Channel6
#define USART2_Tx_DMA_IRQn		 DMA1_Channel7_IRQn
#define USART2_Rx_DMA_IRQn		 DMA1_Channel6_IRQn
#define USART2_DR_Base			 0x40004404

//****************************************************	
// 				USART3 CONFIGURATION
//****************************************************
#define USART3_CLK               RCC_APB1Periph_USART3
#define USART3_GPIO				 GPIOB
#define USART3_GPIO_CLK          RCC_APB2Periph_GPIOB
#define USART3_RxPin             GPIO_Pin_11
#define USART3_TxPin             GPIO_Pin_10
#define USART3_Tx_DMA_Channel	 DMA1_Channel2
#define USART3_Rx_DMA_Channel	 DMA1_Channel3
#define USART3_Tx_DMA_IRQn		 DMA1_Channel2_IRQn
#define USART3_Rx_DMA_IRQn		 DMA1_Channel3_IRQn
#define USART3_Tx_DMA_FLAG		 DMA1_FLAG_TC2
#define USART3_DR_Base			 0x40004804

//****************************************************	
// 				ADCs CONFIGURATION
//****************************************************
#define ADC_DMA_Channel		 DMA1_Channel1
#define ADC_DMA_IRQn		 DMA1_Channel1_IRQn
#define ADC_X_GPIO			 GPIOB
#define ADC_Y_GPIO			 GPIOB
#define ADC_Z_GPIO			 GPIOA
#define ADC_X_PIN		     GPIO_Pin_1
#define ADC_Y_PIN			 GPIO_Pin_0
#define ADC_Z_PIN			 GPIO_Pin_7
#define ADC_X_CHANNEL		 ADC_Channel_9
#define ADC_Y_CHANNEL		 ADC_Channel_8
#define ADC_Z_CHANNEL		 ADC_Channel_7


//****************************************************	
// 				MMA7631 CONFIGURATION
//****************************************************
#define MMA_CTRL_GPIO		GPIOA
#define MMA_GSEL_PIN		GPIO_Pin_4
#define MMA_0GDET_PIN		GPIO_Pin_5
#define MMA_SLEEP_PIN		GPIO_Pin_6

//****************************************************	
// 				DS18B20 CONFIGURATION
//****************************************************
#define DS18B20_GPIO		GPIOB
#define DS18B20_GPIO_PIN	GPIO_Pin_12

//****************************************************	
// 				EXT-INTERRUPT CONFIGURATION
//****************************************************
#define CSINT_GPIO			GPIOB
#define CSINT_PIN			GPIO_Pin_14

#define LASER1_GPIO			GPIOB
#define LASER1_PIN			GPIO_Pin_13

#if (0) /* hardware fixed */
// #define LASER2_GPIO			GPIOC
// #define LASER2_PIN			GPIO_Pin_13

// #define LASER3_GPIO			GPIOC
// #define LASER3_PIN			GPIO_Pin_14
#else 
#define LASER2_GPIO			GPIOA
#define LASER2_PIN			GPIO_Pin_0

#define LASER3_GPIO			GPIOC
#define LASER3_PIN			GPIO_Pin_15
#define LASER3_IRQn			EXTI3_IRQn

#endif

//****************************************************	
// 				EEPROM CONFIGURATION
//****************************************************
#define EEPROM_GPIO			GPIOB
#define EEPROM_WP_PIN		GPIO_Pin_5
#define EEPROM_SCL_PIN		GPIO_Pin_6
#define EEPROM_SDA_PIN		GPIO_Pin_7


//****************************************************	
// 				HC-05 CONFIGURATION
//****************************************************


#endif /* PHYSENSOR */

/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */

#endif /* __PLATFORM_CONFIG_H */

/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
